/*
 * Package il.ac.biu.cs.grossmm.api.data
 * File NodeType.java
 * 
 * This is a part of presence service framework API. 
 * See javadoc for more information.
 *  
 * Copyright (C) 2006 Grossmann Mark
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
package il.ac.biu.cs.grossmm.api.data;


/**
 * Represents a data node type. Node type consists of a tuple of properties and
 * a tuple of node-sets. A property is defined by the java type of values which
 * can be stored in it. A node-set is defined by type of data nodes which can be
 * contained in it.
 * 
 * @see Property
 * @see Unique
 * @see NodeSet
 * @see NodeTypeByInterface
 * @see NodeOf
 * @see SetOf
 * 
 * @author Mark Grossmann
 */
public interface NodeType<N> {
	/**
	 * Returns number of properties in this node type
	 * 
	 * @return number of properties in this node type
	 */
	int propertiesNumber();

	/**
	 * Returns number of node-sets in this node type
	 * 
	 * @return number of node-sets in this node type
	 */
	int nodesetsNumber();

	/**
	 * Returns a property at given position in the tuple of properties. If index
	 * is out of range then <tt>IndexOutOfBoundsException</tt> exception is
	 * thrown
	 * 
	 * @param index
	 *            position in the tuple of properties
	 * @return a property at given position in the tuple of properties
	 * 
	 * @throws IndexOutOfBoundsException
	 */
	Property property(int index) throws IndexOutOfBoundsException;

	/**
	 * Returns a node-set at given position in the tuple of node-set. If index
	 * is out of range then <tt>IndexOutOfBoundsException</tt> exception is
	 * thrown
	 * 
	 * @param index
	 *            position in the tuple of v
	 * @return a property at given position in the tuple of node-set
	 * 
	 * @throws IndexOutOfBoundsException
	 */
	Nodeset nodeset(int index) throws IndexOutOfBoundsException;
}
